package com.ruoyi.business.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.bizsys.domain.*;
import com.ruoyi.business.domain.CustomerVO;
import com.ruoyi.business.domain.BusinessMarketUser;
import com.ruoyi.business.domain.RaiseLimitTaskVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @Author: Jamnsin
 * @Date: 2019/12/6 4:13 下午
 */
@Mapper
public interface BusinessMapper {

    List<CustBindCardLog> selectBindCardPending();

    List<String> selectUserIdNoCust();

    int selectExtReqLogCount(String apiName);

    List<ExtReqLog> selectExtReqLogList(Map<String, Object> map);

    /**
     * 查询当日总数 并且返回最新的时间
     * @param userUuid
     * @return
     */
    Map getRealNameLogCountOfDayAndLatestTime(@Param("userUuid")String userUuid);

    void bankUpLoanInfo(LoanIou loanIou);

    void backUpCreditAccount(CreditAccount creditAccount);

    List<CreditApply> getTempCredotApplyList(@Param("userId")String userId);

    List<LoanOrder> getTempLoanOrderList(@Param("custNo")String custNo);

    /**
     * 追加
     * @param custNo
     * @return
     */
    int appendErrorMsgByCustNo(@Param("custNo")String custNo,@Param("errorMsg")String errorMsg);

    /**
     * 实名接口是否有后续扭转
     * @param apiDictValue
     * @return
     */
    int dictValueFollowUp(@Param("apiDictValue") String apiDictValue);

    /**
     * 授信成功未提交提现
     * @return
     */
    List<RaiseLimitTaskVo> getCreditWithoutLoanList();

    /**
     * 获取客户信息，自定义sql 需要什么字段自行添加
     * @param custId
     * @return
     */
    CustomerVO getCustomerInfo(@Param("custId") String custId);


    /**
     * 获取未初始化设备指纹的deviceInfo
     * @return
     */
    List<AppDeviceInfo> getDeviceOfUninitialized();


    int saveBatchDdeviceFingerprints(@Param("fingerprints") List<AppDeviceFingerprint> fingerprints);

    /**
     * 获取设备上一次版本
     * @param userId
     * @return
     */
    String getDeviceFirstVersion(@Param("userId") String userId);

    /**
     * 获取设备映射
     * @return
     */
    List<Map<String,String>> getDeviceMapperMaps();

    /**
     * 创建设备品牌映射
     * @param phoneBrand
     * @return
     */
    String getDeviceMapper(@Param("phoneBrand") String phoneBrand);

    /**
     * 更新客户信用评级
     * @param creditRating
     * @param customerNo
     * @return
     */
    int upCreditRatingByCustNo(@Param("creditRating") String creditRating,@Param("customerNo") String customerNo);

    /**
     * 提现或授信 时 营销用户信息修改
     * @param marketUser
     */
    void loanOrCreditUpdateMarketUserInfo(BusinessMarketUser marketUser);
}
